function getParams(url) {
  const regex = /[?&]([^=#]+)=([^&#]*)/g;
  const params = {};
  let match;
  while ((match = regex.exec(url))) {
    params[decodeURIComponent(match[1])] = decodeURIComponent(match[2]);
  }
  if(!params.user){
    window.location.href='./tip.html'
  }
  return params;
}
function formatTime(time) {
  return dayjs(time * 1000).format("YYYY-MM-DD hh:mm:ss");
}
function upload(formData) {
  return new Promise((resolve, reject) => {
    axios
      .post("https://cs3.maoxiandao.xin/index.php/api/common/upload", formData)
      .then((res) => {
        console.log(res);
        if (res.data.code == 1) {
          resolve(res.data.data.fullurl);
        }
      })
      .catch((err) => {
        console.log(err);
      });
  });
}


